<html>
<?php
	include_once("ClsSebent/config.php");
		
	//$_SESSION['SITE_ID']=101;
	$sql="SELECT * FROM site_home WHERE id='".$_SESSION['SITE_ID']."'";

	$result = mysql_query($sql);
	$num=1;
	if($data=mysql_fetch_array($result))
	{
?>
<head>
<title><?php echo $data["meta_title"];?></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="keywords" content="<?php echo $data["meta_keywords"];?>">
<meta name="description" content="<?php echo $data["meta_description"];?>">
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<style>
.body {
	background-color: #<?php echo $data["page_bg_color"]; ?>;
}
.body,td,th {
	font-size: 14px;
	color: #<?php echo $data["page_tdtext_color"];?>;
	font-weight: bold;
}
a:link {
	color: #<?php echo $data["page_link_text_color"]; ?>;
}
a:visited {
	color: #<?php echo $data["page_link_visited_color"]; ?>;
}
a:hover {
	color: #<?php echo $data["page_link_rollover_color"]; ?>;
}
a:active {
	color: #<?php echo $data["page_link_rollover_color"]; ?>;
}
.h1 {
	font-weight: bold;
	font-size: 24px;
	color: #<?php echo $data["page_text_color"]; ?>;
}
.h2 {
	font-weight: bold;
}
.h3 {
	font-weight: bold;
}
.h4 {
	font-weight: bold;
}
.h5 {
	font-weight: bold;
}
.h6 {
	font-weight: bold;
}
.h2 {
	font-size: 16px;
	color: #<?php echo $data["page_text_color"]; ?>;
}
.style4 {font-size: 14px}
.style7 {
	font-family: Dauphin;
	font-size: 24px;
	color: #<?php echo $data["page_text_color"]; ?>;
}
.style9 {color: #FFFFFF}
.style10 {font-size: 26px}
.style13 {font-size: 36px}
h3 {
	font-size: 16px;
	color: #<?php echo $data["page_text_color"]; ?>;
}
.style8 {font-size: 24px}
.style1 {font-size: 24px;
	font-weight: bold;
	font-style: italic;
	color: #<?php echo $data["page_text_color"]; ?>;
}

</style><body class="body">
<!-- We Offer cd duplication, cd replication, cd rom duplication, cd rom replication, cd duplication services, cheap cd duplication, cd dvd replication, cd business card replication, cd replication services, bulk cd replication Services. Start your own record label. -->
<table width="100%"  border="0" summary="CD Duplication">
  <tr>
    <th height="698" scope="col"><table width="800" height="696" border="5" align="center" bordercolor="#<?php echo $data["bdr_color1"];?>" summary="cd replication">
      <tr>
        <th height="682" scope="col"><table width="100%"  border="2" align="center" bordercolor="<?php echo $data["bdr_color2"];?>">
          <tr>
            <th background='photos/header/<?php echo  $_SESSION['SITE_ID'] . "_" . $data["page_bg_image"]; ?>' scope="col"><table width="100%"  border="0">
                <tr>
                  <th width="21%" height="153" scope="col"><?php
		  if($data["logo"] !=""){ ?>
                  <img src='logos/<?php echo $_SESSION['SITE_ID'] . "_frontlogo.jpg";?>' alt="<?php $log=$data["logo_alt"]; $log=stripslashes($log); $log=str_replace('"','&quot;',$log); echo $log; ?>" width="150" height="149" align="middle"><?php
                  }  
		  ?></th>
                  <th width="54%" scope="col">
					  <p align="center"><font face="Arial" size="6"><?php echo $data["company_name"]; ?></font></p>
					  <p align="center"><font face="Arial" size="2"><?php echo $data["slogan"]; ?></font></td>
				  </th>
                  <th width="25%" scope="col"><?php echo nl2br ($data["contact_info"]); ?></th>
                </tr>
            </table></th>
          </tr>
          <tr>
            <td height="507"><table width="100%"  border="2" bordercolor="<?php echo $data["bdr_color3"];?>">
                <tr>
                  <th width="21%" height="495" align="center" valign="top" background='photos/navbar/<?php echo  $_SESSION['SITE_ID'] . "_" . $data["page_bg_image"]; ?>' scope="col"><table width="100%" height="489"  border="0">
                      <tr>
                        <th valign="top" scope="col" align='left'><table width="100%"  border="0" summary="Navbar Table">
					<?php
						$sql="SELECT * FROM site_navbar WHERE site_id='".$_SESSION['SITE_ID']."' AND link_active='Y' AND link_parent=0 ORDER BY link_position, link_text";
						$nav_res = mysql_query($sql);
						while($nav_data=mysql_fetch_array($nav_res)){
							if($nav_data["link_page"] == 10){
								?><tr><td><a target="_self" class="style4" href='shop.php?site_id=<?php echo $_SESSION['SITE_ID']; ?>'><?php
								echo $nav_data["link_text"];
								?></a></td></tr><?php
							}
							else{
								?><tr><td><a target="_self" class="style4" href='page.php?site_id=<?php echo $_SESSION['SITE_ID']; ?>&pid=<?php echo $nav_data["link_page"]; ?>'><?php
								echo $nav_data["link_text"];
								?></a></td></tr><?php

								$sql="SELECT * FROM site_navbar WHERE site_id='".$_SESSION['SITE_ID']."' AND link_active='Y' AND link_parent=" . $nav_data["id"] . " ORDER BY link_position, link_text";

								$nav_res2 = mysql_query($sql);
								while($nav_data2=mysql_fetch_array($nav_res2)){
									$link_text=$nav_data2["link_text"];
									?><tr><td>&nbsp;&nbsp;&nbsp;<a target="_self" class="style4" href='page.php?site_id=<?php echo $_SESSION['SITE_ID']; ?>&pid=<?php echo $nav_data2["link_page"]; ?>'><?php
									echo $nav_data2["link_text"];
									?></a></td></tr><?php
								}
							}
						}
					?>                            
                            <tr>
                              <td height="19" align="center">&nbsp;</td>
                            </tr>
                        </table></th>
                      </tr>
                  </table></th>
                  <th width="79%" align="center" valign="top" scope="col"><table width="100%"  border="0">
                      <tr>
                        <th width="2%" height="103" scope="col">&nbsp;</th>
                        <th width="96%" align="center" valign="top" scope="col"><table width="100%"  border="0">
                            <tr>
                              <th align="center" valign="top" scope="col"><h1><font color='#<?php echo $data["page_title_color"]; ?>'>Products</font></h1>
							  <?php
								$sql="SELECT DISTINCT(product_category) as product_category FROM product_master WHERE product_category!='' ORDER BY product_category";
								$result = mysql_query($sql);
								while($row=mysql_fetch_array($result)){
									$product_cat=$row["product_category"];
									echo "<a href='shop.php?site_id=".$_SESSION['SITE_ID']."&pro_id=$product_cat'>$product_cat</a>&nbsp; &nbsp;";
								}
								echo "<a href=shop.php?site_id=".$_SESSION['SITE_ID']."&pro_id=ALL>ALL</a>";
							  ?>
							  </th>
                            </tr>
                            <tr>
                              <td height="400" valign=top align=center>
							  <?php
									if("$page" =="") $page=1;
									$item_max_on_page=3;
									$item_start_no=($page-1)*$item_max_on_page+1;
									
									// $sql="SELECT * FROM site_product WHERE site_id='".$_SESSION['SITE_ID']."'";
									$sql="SELECT * FROM site_product,product_master WHERE site_product.site_id='".$_SESSION['SITE_ID']."' AND site_product.product_id=product_master.id";
									if("$pro_id"!="ALL" && "$pro_id"!="")$sql="$sql AND product_master.product_category='$pro_id'";
									$sql="$sql ORDER BY product_position";
									$page_res = mysql_query($sql);
									$item_no=0;
									$item_on_page=$item_max_on_page;
									$item_total_count=mysql_num_rows($page_res);
									if($item_total_count==0) echo "No Products!";
									else{
									?><div align=right><FONT COLOR="#<?php echo $data["page_title_color"]; ?>">Currently at Page # <?php echo $page; ?>. Go to page # <?php
									for ($i=1; $i<= ceil($item_total_count/$item_max_on_page); $i++){
										echo "<a href=shop.php?site_id=".$_SESSION['SITE_ID']."&_id=$page_id&page=$i>$i</a>&nbsp;&nbsp;"; 
									}
									echo "</FONT></div>";
									while($row=mysql_fetch_array($page_res)){
										$item_no++;
										if($item_no<$item_start_no) continue;
										$pro_id=$row["product_id"];
										$product_title=$row["product_title"];
										$product_category=$row["product_category"];
										$price=$row["price"];
										$profit_pct=$row["profit_pct"];
										$tax_pct=$row["tax_pct"];
										$shipping_amt=$row["shipping_amt"];
											$product_desc=$row["product_desc"];
											$product_img=$row["product_img"];
											$product_img_alt=$row["product_img_alt"];
											$product_price=$row["product_price"];
/*
										$sql="SELECT * FROM product_master WHERE id='$pro_id'";

										$result_pro_master = mysql_query($sql);
										if($row_pro_master=mysql_fetch_array($result_pro_master)){
											$product_desc=$row_pro_master["product_desc"];
											$product_img=$row_pro_master["product_img"];
											$product_img_alt=$row_pro_master["product_img_alt"];
											$product_price=$row_pro_master["product_price"];
										}
										else{
											$product_title="";
											$product_desc="";
											$product_img="";
											$product_img_alt="";
											$product_price="";
										}
*/
										?><TABLE border=1 width="100%" cellpadding=5 cellspacing=0>
										<TR>
											<TH colspan=2><H3><font color='#<?php echo $data["page_title_color"]; ?>'><?php echo $product_title . " (" . $product_category . ")"; ?></font></H3></Th>
										</TR>
										<TR>
											<TD width="175" height="175"><center><img width=100 src="<?php echo "photos/products/${pro_id}_$product_img"; ?>" border=0 alt="<?php echo $product_img_alt; ?>"></center></TD>

											<TD><font color='#<?php echo $data["page_text_color"]; ?>'><?php echo $product_desc; ?><BR><BR>Price : $<?php echo $price; ?><!-- <BR>Tax : $<?php echo ($price * (100+$tax_pct)/100); ?><BR>Shipping : $<?php echo $shipping_amt; ?> --></font></TD>											
										</TR>
										<TR>
										<td colspan="2">Addons With this project.
										<table width="100%" border="0">
  <tr>
    <td width="57%">Addon</td>
    <td width="43%">Price Increase</td>
  </tr>
  <?php //Listing Addons.
  $adq="select * from `product_addon` p inner join site_addon s on p.addon_id =s.addon_id where s.site_id=".$_SESSION['SITE_ID']." and s.product_id=$pro_id and Active='Y'";
  $ar=mysql_query($adq);
  while($adrow=mysql_fetch_array($ar))
  {
  ?>
  <tr>
    <td><?php echo $adrow['addon_title'];?></td>
    <td><A HREF="addon_pr_det.php?site_id=<?php echo site_id;?>&aid=<?php echo $adrow['addon_id'];?>", target="_blank">View pricing details</A></td>
  </tr>
  <?php }?>
</table>

										</td>
										</TR>
										<TR>
											<TH colspan=2><A HREF="basket.php?site_id=<?php echo $_SESSION['SITE_ID']; ?>&pid=<?php echo $pro_id; ?>" target="_blank"><font color='#<?php echo $data["page_text_color"]; ?>'>Buy Now  </font></A>&nbsp;<A HREF="cart_details.php?site_id=<?php echo $_SESSION['SITE_ID']; ?>&pid=<?php echo $pro_id; ?>" target="_blank"><font color='#<?php echo $data["page_text_color"]; ?>'>Add To Cart  </font></A>&nbsp;<A HREF="cart_view.php?site_id=<?php echo $_SESSION['SITE_ID']; ?>" target="_blank"><font color='#<?php echo $data["page_text_color"]; ?>'>View Cart  </font></A>&nbsp;<A HREF="basket.php?site_id=<?php echo $_SESSION['SITE_ID']; ?>&pid=<?php echo $pro_id; ?>" target="_blank"><font color='#<?php echo $data["page_text_color"]; ?>'>Check Out  </font></A></Th>
										</TR>
										</TABLE><BR><?php
										$item_on_page--;
										if($item_on_page<1) break;
									}
							?><div align=right><FONT COLOR="#<?php echo $data["page_title_color"]; ?>">Currently at Page # <?php echo $page; ?>. Go to page # <?php
								for ($i=1; $i<= ceil($item_total_count/$item_max_on_page); $i++){
									echo "<a href=shop.php?site_id=".$_SESSION['SITE_ID']."&_id=$page_id&page=$i>$i</a>&nbsp;&nbsp;"; 
								}
								?></font></div><?php
									}
								?>
							&nbsp;</td>
                            </tr>
                            <tr>
                              <td><h3 align="center"><font color='#<?php echo $data["page_title_color"]; ?>'><?php echo $data["copyright"]; ?></font></h3></td>
                            </tr>
                            <!-- <tr>
                              <td height="21"><h3 align="center">Report any problems with web site to <a href="/Templates/CS@KingOfEnterprise.com">Webmaster@KingOfEnterprise.com</a></h3></td>
                            </tr> -->
                        </table></th>
                        <th width="2%" scope="col">&nbsp;</th>
                      </tr>
                  </table></th>
                </tr>
            </table></td>
          </tr>
        </table></th>
      </tr>
    </table></th>
  </tr>
</table>
</body>
<?php
	}
?>

</html>